package org.crackjack.android.adapter;

import org.crackjack.android.R;
import org.crackjack.android.model.Appointment;

import android.view.View;
import android.widget.TextView;

public class AppointmentBinder implements IViewBinder<Appointment> {

    @Override
    public int getViewLayoutId() {
        return R.layout.item_appointment;
    }

    @Override
    public void bindView(View view, Appointment item) {
        ((TextView) view.findViewById(R.id.txv_appointment_name)).setText(item.getName());
        ((TextView) view.findViewById(R.id.txv_appointment_rating)).setText(item.getRating().toString());
        ((TextView) view.findViewById(R.id.txv_appointment_owner_name)).setText(item.getAppointmentOwner().getLogin());
        view.setTag(item.getId());
    }
}
